package com.copm.ifm.servers.sys.mapper;

import com.copm.ifm.servers.sys.entity.SysEquipmentType;
import com.copm.ifm.servers.sys.entity.SysLocationType;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.copm.ifm.servers.sys.vo.SysEquipmentTypeVO;
import com.copm.ifm.servers.sys.vo.SysLocationTypeVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 位置分类表 Mapper 接口
 * </p>
 *
 * @author tp
 * @since 2020-12-30
 */
public interface SysLocationTypeMapper extends BaseMapper<SysLocationType> {

    List<SysLocationType> getLocaTypeTree(@Param("tenantId") int tenantId, @Param("projId")int projId, @Param("enabled")int enabled);

    SysLocationTypeVO selectParentLoaById(@Param("parentLoId")Integer parentLoId);

    Integer selectMaxSeq(@Param("tenantId") int tenantId, @Param("projId")int projId, @Param("level")int level);

    SysLocationType checkEquCode(@Param("tenantId") int tenantId, @Param("projId")int projId, @Param("code")String code);

    SysLocationType checkEquName(@Param("tenantId") int tenantId, @Param("projId")int projId, @Param("name")String name);

    String selectMaxPath(@Param("tenantId") int tenantId, @Param("projId")int projId, @Param("parentPath")String parentPath);

    int updateLeafNode(SysLocationType temp);

    List<SysLocationType> selectLocationTypebyName(@Param("tenantId")Integer tenantId,@Param("projectId")Integer projectId,@Param("name")String name,@Param("parentPath")String parentPath);

    List<SysLocationType> selectLocationTypebyLevel(@Param("tenantId")Integer tenantId,@Param("projectId")Integer projectId,@Param("name")String name,@Param("level")Integer level);

    SysLocationType selectHaveChild(Integer tenantId, Integer projectId, String path);

    SysLocationType selectLocationTypeNotEnable(Integer tenantId, Integer projectId, String path);

    SysLocationType selectLocationTypeByParentpath(Integer tenantId, Integer projectId, String parentPath);

}
